package com.example.zzl.view.activity.HomeFragment;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;

import com.example.zzl.R;
import com.example.zzl.databinding.ActivityInfoListBinding;
import com.example.zzl.view.BaseView;
import com.example.zzl.viewmodel.HomeFragment.InfoListPresenter;

public class InfoListActivity extends AppCompatActivity implements InfoListPresenter.InfoListCallback {

    private String headTitle;
    private ActivityInfoListBinding db;
    private InfoListPresenter presenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        initIntent();
        db = DataBindingUtil.setContentView(this, R.layout.activity_info_list);
        presenter = new InfoListPresenter(this, this, db);
        db.include.toolbar.setTitle("");
        setSupportActionBar(db.include.toolbar);
        BaseView.initPresenter(presenter);
    }

    private void initIntent() {
        headTitle = getIntent().getStringExtra("headTitle");
    }

    @Override
    public String getHeadTitle() {
        return headTitle;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case -1:
                finish();
                break;

            case 0:

                break;

            default:
                break;
        }

    }
}
